<?php
    //require_once '../config.php';
    require_once '../classes/xl_loai_du_an.php';
    require_once '../classes/xl_loai_hinh_kinh_doanh.php';
    require_once '../classes/xl_loai_phieu.php';
    //require_once '../DTO/DOANHNGHIEP_DTO.php';

    $xl_lhkd =new xl_loai_hinh_kinh_doanh();
    $xl_lp = new xl_loai_phieu();
    $xl_lda = new xl_loai_du_an();

    $loai_du_an = $xl_lda->danh_sach();
    $ldn = $xl_lhkd->danh_sach();

    $phieu_ban_dn =$xl_lp->lay_ma(ban_dn);
    $phieu_tim_td = $xl_lp->lay_ma(tim_td);
    $phieu_tim_ndt = $xl_lp->lay_ma(tim_ndt);


?>

<div class="elements">
    <h3 class="ui-widget-header widgets">
        <div class="title">Cơ hội</div>
    </h3>

    <div id="accordion">


        <h3><a href="#">Mua các DN muốn bán</a></h3>
        <ul>
            <?php foreach($ldn as $row){ ?>

                <li class="menu">
                    <a href="../co_hoi/danh_sach_mdn.php?ma_lhkd=<?php echo $row['ma']?>&ma_p=<?php echo $phieu_ban_dn?>"
                                    class="text"><?php echo $row['ten_loai'] ?>
                    </a>
                </li>
            <?php } ?>

            <li class="menu"><a href="../co_hoi/danh_sach_mdn.php?ma_lhkd=all&ma_p=<?php echo $phieu_ban_dn?>"
                                class="text">Toàn bộ các DN</a>
            </li>

        </ul>



        <h3><a href="#">Dự án mời đầu tư</a></h3>
        <ul>
            <?php foreach($loai_du_an as $row){ ?>
                <li class="menu">
                    <a href="../co_hoi/danh_sach_dadt.php?ma_lda=<?php echo $row['ma']?>&ma_p=<?php echo $phieu_tim_ndt?>"
                       class="text"><?php echo $row['ten_loai']  ?></a></li>
            <?php } ?>
            <li class="menu">
                <a href="../co_hoi/danh_sach_dadt.php?ma_lda=all&ma_p=<?php echo $phieu_tim_ndt?>"
                   class="text">Toàn bộ các dự án</a>
            </li>
        </ul>




        <h3><a href="#">Những DN cần vay vốn</a></h3>
        <ul>
            <?php foreach($ldn as $row){ ?>

            <li class="menu">
                <a href="../co_hoi/danh_sach_dnvv.php?ma_lhkd=<?php echo $row['ma']?>&ma_p=<?php echo $phieu_tim_td?>"
                   class="text"><?php echo $row['ten_loai'] ?>
                </a>
            </li>
            <?php } ?>

            <li class="menu"><a href="../co_hoi/danh_sach_dnvv.php?ma_lhkd=all&ma_p=<?php echo $phieu_tim_td?>"
                                class="text">Toàn bộ các DN</a>
            </li>
        </ul>

    </div>

    <script type="text/javascript">

        $(function () {
            $("#accordion").accordion({
                autoHeight :false,
                animated   :'easeOutBounce',
                active     :1000,
                navigation :true,
                collapsible:true
            });
        });

    </script>
</div>